﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Pibby.UI
{
	public partial class ProgressView : UserControl
	{
		public ProgressView()
		{
			InitializeComponent();
		}

		public string Title
		{
			get { return this.titleLabel.Text; }
			set { this.titleLabel.Text = value; }
		}

		public string Description
		{
			get { return this.textLabel.Text; }
			set { this.textLabel.Text = value; }
		}

		public int ProgressMaximum
		{
			get { return this.progressBar1.Maximum; }
			set { this.progressBar1.Maximum = value; }
		}

		public int ProgressValue
		{
			get { return this.progressBar1.Value; }
			set { this.progressBar1.Value = value; }
		}

		public Image Image
		{
			get { return this.pictureBox1.Image; }
			set { this.pictureBox1.Image = value; }
		}

		public string ImageName
		{
			get{ return this.pictureBox1.Name; }
			set 
			{
				if (string.IsNullOrEmpty(value))
					return;

				using (System.IO.Stream s = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(value))
				{
					if (s != null)
						this.pictureBox1.Image = Bitmap.FromStream(s);
				}

			}
		}

	}
}
